﻿<UserControl x:Class="RandomFileCopier.Controls.MinMaxControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:RandomFileCopier"
             xmlns:resx="clr-namespace:RandomFileCopier.Properties"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300"
             xmlns:xceed="clr-namespace:Xceed.Wpf.Toolkit;assembly=Xceed.Wpf.Toolkit"
             Name="MinMaxControlName">
    
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="26"/>
            <ColumnDefinition Width="90"/>
            <ColumnDefinition Width="26"/>
            <ColumnDefinition Width="90"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Name="LabelRowDefinition" Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="{Binding ActualHeight, ElementName=MinimumSizeLabel}"/>
        </Grid.RowDefinitions>
        <Slider Margin="4 0 2 0" ValueChanged="Slider_ValueChanged" Thumb.DragCompleted="Slider_DragCompleted" Thumb.DragStarted="Slider_DragStarted"  Value="{Binding MinValue, ElementName=MinMaxControlName}" Orientation="Vertical" Height="Auto" TickFrequency="0.1" IsSnapToTickEnabled="True" Grid.Row="0" Grid.Column="0" Grid.RowSpan="3"  Minimum="0" Maximum="{Binding MaxSliderValue, ElementName=MinMaxControlName}"/>
        <Label Name="MinimumSizeLabel" Grid.Column="1" Grid.Row="0" Content="{Binding SizeUnit, ElementName=MinMaxControlName}" ContentStringFormat="{x:Static resx:Resources.MinimumFileSize}" />
        <xceed:DecimalUpDown ShowButtonSpinner="False" Value="{Binding MinValue, ElementName=MinMaxControlName}" Grid.Column="1" Grid.Row="1"  Minimum="0" Maximum="{Binding MaxSliderValue, ElementName=MinMaxControlName}"/>
        <Slider Margin=" 4 0 2 0"  ValueChanged="Slider_ValueChanged" Thumb.DragCompleted="Slider_DragCompleted" Thumb.DragStarted="Slider_DragStarted" Value="{Binding MaxValue, ElementName=MinMaxControlName}" Orientation="Vertical" Height="Auto" TickFrequency="0.1" IsSnapToTickEnabled="True" Grid.Row="0" Grid.Column="2" Grid.RowSpan="3"  Minimum="0" Maximum="{Binding MaxSliderValue, ElementName=MinMaxControlName}"/>
        <Label Grid.Column="3" Grid.Row="0" Content="{Binding SizeUnit, ElementName=MinMaxControlName}" ContentStringFormat="{x:Static resx:Resources.MaximumFileSize}" />
        <xceed:DecimalUpDown ShowButtonSpinner="False" Value="{Binding MaxValue, ElementName=MinMaxControlName, UpdateSourceTrigger=PropertyChanged}" Grid.Column="3" Increment="0.1" Grid.Row="1"  Minimum="0" Maximum="{Binding MaxSliderValue, ElementName=MinMaxControlName}"/>
    </Grid>
</UserControl>
